import {ref} from 'vue'
import {defineStore} from 'pinia'


export const useContextStore = defineStore('userContext', () => {
  const pbUserInfo = ref({
    userId: "",
    userName: "",
    balance: 0.0,
  })

  const imUserInfo = ref({
    userId: "",
    userName: "",
    balance: 0.0,
  })

  function setPbUserInfo(item) {
    pbUserInfo.value = item
  }

  function getPbUserInfo(item) {
    return pbUserInfo.value
  }

  function setImUserInfo(item) {
    pbUserInfo.value = item
  }

  function getImUserInfo(item) {
    return imUserInfo.value
  }

  return {pbUserInfo, imUserInfo, setPbUserInfo, getPbUserInfo, getImUserInfo, setImUserInfo}
})
